export const layoutComponents = (() => {
    //path,useSubdirectories,regExp
    const context = require.context("../layout", true, /.js$/);
    let paths = context.keys();
    let components = paths.map(item => {
        let componentName = item.split("/").pop().split(".js").shift();
        return {
            name: componentName,
            path: `/${componentName.toLowerCase()}`,
            component: context(item).default,
        };
    });
    return components;
})();
export const viewsComponents = (() => {
    //path,useSubdirectories,regExp
    const context = require.context("../views", true, /.js$/);
    let paths = context.keys();
    let components = paths.map(item => {
        let name = item.split("/").pop().split(".js").shift();
        let path = `/main/${item.split("./").pop().split(".js").shift().toLowerCase()}`;
        return {
            name,
            path,
            component: context(item).default,
        };
    });
    return components;
})();
